package com.example.mobile2021606140lhq0415;

import android.os.Bundle;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

public class MainActivity extends AppCompatActivity {

    private TextView tvMainTitle;
    private RecyclerView rvMainPeople;
    private String[] names = {"丁运生", "方华高", "朱云贵", "邹辉", "杨文", "朱元元", "周正文", "张伟"};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        rvMainPeople.setLayoutManager(new LinearLayoutManager(this));
        PeopleAdapter adapter = new PeopleAdapter(names);
        rvMainPeople.setAdapter(adapter);
    }

    private void initView() {
        tvMainTitle = (TextView) findViewById(R.id.tv_main_title);
        rvMainPeople = (RecyclerView) findViewById(R.id.rv_main_people);
    }
}